#ifndef WORKFIELD_H
#define WORKFIELD_H

#include <wx/panel.h>
#include "Renderer.h"
#include "Documents/IDocument.h"

class WorkFieldPanel : public wxPanel
{
	public:
		WorkFieldPanel(
			wxWindow *parent,
            wxWindowID winid = wxID_ANY,
            const wxPoint& pos = wxDefaultPosition,
            const wxSize& size = wxDefaultSize,
            long style = wxTAB_TRAVERSAL | wxNO_BORDER,
            const wxString& name = wxPanelNameStr);
		virtual ~WorkFieldPanel();

		void SetDocument(IDocument* document){ _document = document; }
		IDocument* GetDocument(){ return _document; }

	protected:
		void OnPaint( wxPaintEvent& event );
		void OnSize( wxSizeEvent& event );
		void OnLmbDown( wxMouseEvent& event );
		void OnLmbUp( wxMouseEvent& event );
		void OnRmbDown( wxMouseEvent& event );
		void OnRmbUp( wxMouseEvent& event );
		void OnMouseMove( wxMouseEvent& event );
		void OnMouseWheel( wxMouseEvent& event );

	private:
		void Repaint(wxPaintDC& dc);
		void PaintGrid(wxPaintDC& dc);

	private:
		IDocument* _document;

		Renderer _renderer;
		wxPoint _screenMousePrev;
};

#endif // WORKFIELD_H
